import 'package:flutter/material.dart';
import 'package:flutter_pritice/edit/GoodEditPage.dart';
import '../list/DynamicListPage.dart';
import '../login/LoginPage.dart';
import '/index/GoodIndexPage.dart';

class DemoPage extends StatelessWidget {
  const DemoPage({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text("DemoPage"),
      ),
      body: GridView(
          padding: EdgeInsets.all(10),
          gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
              crossAxisCount: 3,
              childAspectRatio: 3,
              crossAxisSpacing: 20,
              mainAxisSpacing:10
          ),
          children: <Widget>[
            ElevatedButton(onPressed: () {
              Navigator.push(
                  context,
                  MaterialPageRoute(builder: (context) => const GoodIndexPage())
              );
            }, child: Text("好事发生")),
            ElevatedButton(onPressed: () {
              Navigator.push(
                  context,
                  MaterialPageRoute(builder: (context) => const DynamicListPage())
              );
            }, child: Text("动态列表")),
            ElevatedButton(onPressed: () {
              Navigator.push(
                  context,
                  MaterialPageRoute(builder: (context) => const LoginPage())
              );
            }, child: Text("登录"))
          ]),
    );
  }
}
